﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using 渐变.test;
using 渐变.user_Form;

namespace 渐变
{
    public partial class userMain : Form
    {
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case 0x84:
                    base.WndProc(ref m);
                    if ((int)m.Result == 0x1)
                        m.Result = (IntPtr)0x2;
                    return;
            }

            base.WndProc(ref m);
        }
        public userMain()
        {
            InitializeComponent();
        }

        private void uiNavMenu1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            userInfo user = new userInfo();
            user = (userInfo)this.Tag;
            switch (e.Node.Text)
            {
                case "主页":
                    user_welcome welcome = new user_welcome();
                    welcome.MdiParent = this;
                    welcome.Show();
                    break;
                case "租用":
                    user_carFrm rentForm = new user_carFrm();
                    rentForm.operName = user.uUsername;
                    rentForm.MdiParent = this;
                    rentForm.Show();
                    break;
                case "归还":
                    user_returnFrm returnFrm = new user_returnFrm();
                    returnFrm.opname = user.uUsername;
                    returnFrm.MdiParent = this;
                    returnFrm.Show();
                    break;
                case "已支付":
                    is_paymentForm is_Payment = new is_paymentForm();
                    is_Payment.opname = user.uUsername;
                    is_Payment.MdiParent = this;
                    is_Payment.Show();
                    break;
                case "待支付":
                    no_paymentForm no = new no_paymentForm();
                    no.opname = user.uUsername;
                    no.MdiParent = this;
                    no.Show();
                    break;
                case "我的信息":
                    user_MyInformation myInformation = new user_MyInformation();
                    myInformation.opname = user.uUsername;
                    myInformation.ophone = user.uPhone;
                    myInformation.oaddress = user.uAddress;
                    myInformation.opassword = user.uPassword;
                    myInformation.MdiParent = this;
                    myInformation.Show();
                    break;
               
                case "修改密码":
                    user_editPwd editPwd = new user_editPwd();
                    editPwd.opassword = user.uPassword;
                    editPwd.opname = user.uUsername;
                    editPwd.MdiParent = this;
                    editPwd.Show();
                    break;
                case "余额充值":
                    user_Recharge recharge = new user_Recharge();
                    recharge.opname = user.uUsername;
                    recharge.MdiParent = this;
                    recharge.Show();
                    break;
                case "我的违章":
                    user_Violation violation = new user_Violation();
                    violation.opname = user.uUsername;
                    violation.MdiParent = this;
                    violation.Show();
                    break;
                case "已处理":
                    user_MyMsg myMsg = new user_MyMsg();
                    myMsg.opname = user.uUsername;
                    myMsg.MdiParent = this;
                    myMsg.Show();
                    break;
                case "待处理":
                    user_Unprocessed unprocessed = new user_Unprocessed();
                    unprocessed.opname = user.uUsername;

                    unprocessed.MdiParent = this;
                    unprocessed.Show();
                    break;




            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            toolStripStatusLabel2.Text = "系统时间：" + DateTime.Now.ToLongTimeString();
        }

        private void userMain_Load(object sender, EventArgs e)
        {
            userInfo user = new userInfo();
            user = (userInfo)this.Tag;
            toolStripStatusLabel1.Text = "欢迎：" + user.uUsername;
           
        }

        private void uiImageButton2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void uiImageButton1_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
            //this.notifyIcon1.Visible = true;
        }

        private void ucNavigationMenu1_ClickItemed(object sender, EventArgs e)
        {

        }

        private void uiImageButton1_Click_1(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void uiImageButton2_Click_1(object sender, EventArgs e)
        {
            WindowState = FormWindowState.Minimized;
        }
    }
}
